//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
//-----------------------------------------------------------------------------
// <auto-generated>
//   This code was generated by a tool.
//
//   Changes to this file may cause incorrect behavior and will be lost if
//   the code is regenerated.
//
//   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
// </auto-generated>
//-----------------------------------------------------------------------------
#pragma once

namespace org { namespace alljoyn { namespace Onboarding {

// This class, and the associated EventArgs classes, exist for the benefit of JavaScript developers who
// do not have the ability to implement IOnboardingService. Instead, OnboardingServiceEventAdapter
// provides the Interface implementation and exposes a set of compatible events to the developer.
public ref class OnboardingServiceEventAdapter sealed : [Windows::Foundation::Metadata::Default] IOnboardingService
{
public:
    // Method Invocation Events
    event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingConfigureWiFiCalledEventArgs^>^ ConfigureWiFiCalled 
    { 
        Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingConfigureWiFiCalledEventArgs^>^ handler) 
        { 
            return _ConfigureWiFiCalled += ref new Windows::Foundation::EventHandler<Platform::Object^>
            ([handler](Platform::Object^ sender, Platform::Object^ args)
            {
                handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingConfigureWiFiCalledEventArgs^>(args));
            }, Platform::CallbackContext::Same);
        } 
        void remove(Windows::Foundation::EventRegistrationToken token) 
        { 
            _ConfigureWiFiCalled -= token; 
        } 
    internal: 
        void raise(OnboardingServiceEventAdapter^ sender, OnboardingConfigureWiFiCalledEventArgs^ args) 
        { 
            _ConfigureWiFiCalled(sender, args);
        } 
    }

    event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingConnectCalledEventArgs^>^ ConnectCalled 
    { 
        Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingConnectCalledEventArgs^>^ handler) 
        { 
            return _ConnectCalled += ref new Windows::Foundation::EventHandler<Platform::Object^>
            ([handler](Platform::Object^ sender, Platform::Object^ args)
            {
                handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingConnectCalledEventArgs^>(args));
            }, Platform::CallbackContext::Same);
        } 
        void remove(Windows::Foundation::EventRegistrationToken token) 
        { 
            _ConnectCalled -= token; 
        } 
    internal: 
        void raise(OnboardingServiceEventAdapter^ sender, OnboardingConnectCalledEventArgs^ args) 
        { 
            _ConnectCalled(sender, args);
        } 
    }

    event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingOffboardCalledEventArgs^>^ OffboardCalled 
    { 
        Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingOffboardCalledEventArgs^>^ handler) 
        { 
            return _OffboardCalled += ref new Windows::Foundation::EventHandler<Platform::Object^>
            ([handler](Platform::Object^ sender, Platform::Object^ args)
            {
                handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingOffboardCalledEventArgs^>(args));
            }, Platform::CallbackContext::Same);
        } 
        void remove(Windows::Foundation::EventRegistrationToken token) 
        { 
            _OffboardCalled -= token; 
        } 
    internal: 
        void raise(OnboardingServiceEventAdapter^ sender, OnboardingOffboardCalledEventArgs^ args) 
        { 
            _OffboardCalled(sender, args);
        } 
    }

    event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetScanInfoCalledEventArgs^>^ GetScanInfoCalled 
    { 
        Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetScanInfoCalledEventArgs^>^ handler) 
        { 
            return _GetScanInfoCalled += ref new Windows::Foundation::EventHandler<Platform::Object^>
            ([handler](Platform::Object^ sender, Platform::Object^ args)
            {
                handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingGetScanInfoCalledEventArgs^>(args));
            }, Platform::CallbackContext::Same);
        } 
        void remove(Windows::Foundation::EventRegistrationToken token) 
        { 
            _GetScanInfoCalled -= token; 
        } 
    internal: 
        void raise(OnboardingServiceEventAdapter^ sender, OnboardingGetScanInfoCalledEventArgs^ args) 
        { 
            _GetScanInfoCalled(sender, args);
        } 
    }

    // Property Read Events
    event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetVersionRequestedEventArgs^>^ GetVersionRequested 
    { 
        Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetVersionRequestedEventArgs^>^ handler) 
        { 
            return _GetVersionRequested += ref new Windows::Foundation::EventHandler<Platform::Object^>
            ([handler](Platform::Object^ sender, Platform::Object^ args)
            {
                handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingGetVersionRequestedEventArgs^>(args));
            }, Platform::CallbackContext::Same);
        } 
        void remove(Windows::Foundation::EventRegistrationToken token) 
        { 
            _GetVersionRequested -= token; 
        } 
    internal: 
        void raise(OnboardingServiceEventAdapter^ sender, OnboardingGetVersionRequestedEventArgs^ args) 
        { 
            _GetVersionRequested(sender, args);
        } 
    }

    event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetStateRequestedEventArgs^>^ GetStateRequested 
    { 
        Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetStateRequestedEventArgs^>^ handler) 
        { 
            return _GetStateRequested += ref new Windows::Foundation::EventHandler<Platform::Object^>
            ([handler](Platform::Object^ sender, Platform::Object^ args)
            {
                handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingGetStateRequestedEventArgs^>(args));
            }, Platform::CallbackContext::Same);
        } 
        void remove(Windows::Foundation::EventRegistrationToken token) 
        { 
            _GetStateRequested -= token; 
        } 
    internal: 
        void raise(OnboardingServiceEventAdapter^ sender, OnboardingGetStateRequestedEventArgs^ args) 
        { 
            _GetStateRequested(sender, args);
        } 
    }

    event Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetLastErrorRequestedEventArgs^>^ GetLastErrorRequested 
    { 
        Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<OnboardingServiceEventAdapter^, OnboardingGetLastErrorRequestedEventArgs^>^ handler) 
        { 
            return _GetLastErrorRequested += ref new Windows::Foundation::EventHandler<Platform::Object^>
            ([handler](Platform::Object^ sender, Platform::Object^ args)
            {
                handler->Invoke(safe_cast<OnboardingServiceEventAdapter^>(sender), safe_cast<OnboardingGetLastErrorRequestedEventArgs^>(args));
            }, Platform::CallbackContext::Same);
        } 
        void remove(Windows::Foundation::EventRegistrationToken token) 
        { 
            _GetLastErrorRequested -= token; 
        } 
    internal: 
        void raise(OnboardingServiceEventAdapter^ sender, OnboardingGetLastErrorRequestedEventArgs^ args) 
        { 
            _GetLastErrorRequested(sender, args);
        } 
    }

    // Property Write Events
    // IOnboardingService Implementation
    virtual Windows::Foundation::IAsyncOperation<OnboardingConfigureWiFiResult^>^ ConfigureWiFiAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info, _In_ Platform::String^ interfaceMemberSSID, _In_ Platform::String^ interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType);
    virtual Windows::Foundation::IAsyncOperation<OnboardingConnectResult^>^ ConnectAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
    virtual Windows::Foundation::IAsyncOperation<OnboardingOffboardResult^>^ OffboardAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
    virtual Windows::Foundation::IAsyncOperation<OnboardingGetScanInfoResult^>^ GetScanInfoAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);

    virtual Windows::Foundation::IAsyncOperation<OnboardingGetVersionResult^>^ GetVersionAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
    virtual Windows::Foundation::IAsyncOperation<OnboardingGetStateResult^>^ GetStateAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);
    virtual Windows::Foundation::IAsyncOperation<OnboardingGetLastErrorResult^>^ GetLastErrorAsync(_In_ Windows::Devices::AllJoyn::AllJoynMessageInfo^ info);


private:
    event Windows::Foundation::EventHandler<Platform::Object^>^ _ConfigureWiFiCalled;
    event Windows::Foundation::EventHandler<Platform::Object^>^ _ConnectCalled;
    event Windows::Foundation::EventHandler<Platform::Object^>^ _OffboardCalled;
    event Windows::Foundation::EventHandler<Platform::Object^>^ _GetScanInfoCalled;
    event Windows::Foundation::EventHandler<Platform::Object^>^ _GetVersionRequested;
    event Windows::Foundation::EventHandler<Platform::Object^>^ _GetStateRequested;
    event Windows::Foundation::EventHandler<Platform::Object^>^ _GetLastErrorRequested;
};

} } } 
